GATE CSE 2015 SET-1
Q1.
In one of the pairs of protocols given below, both the protocols can use multiple TCP connections between the same client and the server. Which one is that?Q2.
For computers based on three-address instruction formats, each address field can be used to specify which of the following: (S1) A memory operand (S2) A processor register (S3) An implied accumulator registerQ3.
What is the output of the following C code? Assume that the address of x is 2000 (in decimal) and an integer requires four bytes of memory. int main () { unsigned int x[4][3] ={{1,2,3},{4,5,6},{7,8,9},{10,11,12}}; printf("%u, %u, %u", x+3, *(x+3), *(x+2)+3); }Q4.
Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)? I. 3, 5, 7, 8, 15, 19, 25 II. 5, 8, 9, 12, 10, 15, 25 III. 2, 7, 10, 8, 14, 16, 20 IV. 4, 6, 7, 9 18, 20, 25Q5.
What are the worst-case complexities of insertion and deletion of a key in a binary search tree?Q6.
Consider the following C function. int fun1(int n){ int i,j,k,p,q=0; for (i=1; i\lt n; ++i) { p=0; for (j=n; j\gt 1; j=j/2) ++p; for (k=1; k\lt p; k=k*2) ++q; } return q; } Which one of the following most closely approximates the return value of the function fun1?Q10.
The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree of height 5 are